import time

from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop018"
group_name = '好好学习'
firefox = openBrowser(urlAdmin)
DBshopLoginAdmin(firefox)
DBshopEnterMenu3(firefox,'商品管理','商品属性','属性分组')
#1.点击“删除”按钮，确认删除，删除成功。
firefox.find_element_by_xpath('//td[contains(.,"%s")]/following-sibling::td[2]/a[2]'%group_name).click()
firefox.switch_to.alert.accept()
time.sleep(10)
try:
    firefox.find_element_by_xpath('//td[contains(.,"好好学习")]')
    writeLog("%s 测试失败" % testCase)
    getPhoto(firefox)
except:
    writeLog("%s 测试通过" % testCase)

firefox.quit()